//
//  MeiTuanCell.swift
//  MeiTuan
//
//  Created by hnh on 2017/10/25.
//  Copyright © 2017年 henaihan. All rights reserved.
//

import UIKit
class MeiTuanCell: UITableViewCell{
    @IBOutlet weak var pic: UIImageView!
    @IBOutlet weak var name: UILabel!
    @IBOutlet weak var addr: UILabel!
    @IBOutlet weak var price: UILabel!
    @IBOutlet weak var sale: UILabel!
    var model:CateModel!{
        didSet{
            name.text = "\(model.name as String)"
            addr.text = "地址:\(model.addr as String)"
            sale.text = "已售:\(model.sale as String)"
            pic.image = UIImage(named: model.pic as String)
            price.text = "\(model.price as String)元"
        }
    }
    override func awakeFromNib(){
        super.awakeFromNib()
    }
    override func layoutSubviews(){
        super.layoutSubviews()
        self.imageView?.frame = CGRect(x:8,y:4,
                                       width:100,height:72)
        var tmpframe = self.textLabel?.frame
        tmpframe?.origin.x = 116
        self.textLabel?.frame = tmpframe!
    }
    class func createCell(tableView:UITableView)->
    MeiTuanCell{
    let cell =
        tableView.dequeueReusableCell(withIdentifier:
        "meiTuanCell") as! MeiTuanCell
        return cell
        
    
    }
    override func setSelected(_ selected:Bool,
                              animated:Bool){
        super.setSelected(selected, animated:animated)
    }
    
}

